<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class smart_library</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../boost_dll/reference.html#doxygen.shared_library_reference.smart__library_8hpp" title="Header &lt;boost/dll/smart_library.hpp&gt;">
<link rel="prev" href="shared__library__load__mode_8hpp_1a7aead736a07eaf25623ad7bfa1f0ee2d.html" title="Type type">
<link rel="next" href="smart__library_8hpp_1aca01518fa6ec64ce2f8f56ad2a232732.html" title="Function template get">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="shared__library__load__mode_8hpp_1a7aead736a07eaf25623ad7bfa1f0ee2d.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_dll/reference.html#doxygen.shared_library_reference.smart__library_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="smart__library_8hpp_1aca01518fa6ec64ce2f8f56ad2a232732.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class smart_library</span></h2>
<p>boost::dll::experimental::smart_library — This class is an extension of <a class="link" href="classboost_1_1dll_1_1shared__library.html" title="Class shared_library">shared_library</a>, which allows to load C++ symbols. </p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../boost_dll/reference.html#doxygen.shared_library_reference.smart__library_8hpp" title="Header &lt;boost/dll/smart_library.hpp&gt;">boost/dll/smart_library.hpp</a>&gt;

</span>
<span class="keyword">class</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html" title="Class smart_library">smart_library</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a435f8746c65e9afb525fa15d8da36cf7"></a><span class="identifier">mangled_storage</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="../reference_section_of_boost_any/classboost_1_1anys_1_1unique__any.html#id4-bb">public member functions</a></span>
  <span class="keyword">const</span> <a class="link" href="classboost_1_1dll_1_1shared__library.html" title="Class shared_library">shared_library</a> <span class="special">&amp;</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a156b5b44ed1be2f79cf23b13857f9913"><span class="identifier">shared_lib</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">const</span> <span class="identifier">mangled_storage</span> <span class="special">&amp;</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a51212e822e0b370eedf1a8e5918f271f"><span class="identifier">symbol_storage</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="identifier">mangled_storage</span> <span class="special">&amp;</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1ad3d73b1b1a7363aec5a4206d81abeecb"><span class="identifier">symbol_storage</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a2d7c4982300107b0b97267abb8bd33be"><span class="identifier">smart_library</span></a><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>
  <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1aa83355fe2c90155b9aa9472e8ee2f6b0"><span class="identifier">smart_library</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dll</span><span class="special">::</span><span class="identifier">fs</span><span class="special">::</span><span class="identifier">path</span> <span class="special">&amp;</span><span class="special">,</span> 
                <span class="identifier">load_mode</span><span class="special">::</span><span class="identifier">type</span> <span class="special">=</span> <span class="identifier">load_mode</span><span class="special">::</span><span class="identifier">default_mode</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a8103619984d16233cbb3dd1a31ec11d8"><span class="identifier">smart_library</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dll</span><span class="special">::</span><span class="identifier">fs</span><span class="special">::</span><span class="identifier">path</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dll</span><span class="special">::</span><span class="identifier">fs</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&amp;</span><span class="special">,</span> 
                <span class="identifier">load_mode</span><span class="special">::</span><span class="identifier">type</span> <span class="special">=</span> <span class="identifier">load_mode</span><span class="special">::</span><span class="identifier">default_mode</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a8fd9bfbf20917d13b9324184220cd1b0"><span class="identifier">smart_library</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dll</span><span class="special">::</span><span class="identifier">fs</span><span class="special">::</span><span class="identifier">path</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">load_mode</span><span class="special">::</span><span class="identifier">type</span><span class="special">,</span> 
                <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dll</span><span class="special">::</span><span class="identifier">fs</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a692d732536a8d5b771fac684bc89394f"><span class="identifier">smart_library</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html" title="Class smart_library">smart_library</a> <span class="special">&amp;</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>
  <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a592fa252e82dae0e1f9351e0fc8f1859"><span class="identifier">smart_library</span></a><span class="special">(</span><a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html" title="Class smart_library">smart_library</a> <span class="special">&amp;&amp;</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>
  <span class="keyword">explicit</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a753ef075a1a269d1a1a5e0763a7892b5"><span class="identifier">smart_library</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1dll_1_1shared__library.html" title="Class shared_library">shared_library</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">explicit</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1aff3686addd66c5598dbe8dd47635f1cc"><span class="identifier">smart_library</span></a><span class="special">(</span><a class="link" href="classboost_1_1dll_1_1shared__library.html" title="Class shared_library">shared_library</a> <span class="special">&amp;&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a7dbc2b3e3a8c7e5152f6d56c8a2daa8d"><span class="special">~</span><span class="identifier">smart_library</span></a><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a4a953c50b86191dd96aa471bac8099a6"><span class="identifier">load</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dll</span><span class="special">::</span><span class="identifier">fs</span><span class="special">::</span><span class="identifier">path</span> <span class="special">&amp;</span><span class="special">,</span> 
            <span class="identifier">load_mode</span><span class="special">::</span><span class="identifier">type</span> <span class="special">=</span> <span class="identifier">load_mode</span><span class="special">::</span><span class="identifier">default_mode</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1ab226ee5e8f7896cdd3b53dca9704eadd"><span class="identifier">load</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dll</span><span class="special">::</span><span class="identifier">fs</span><span class="special">::</span><span class="identifier">path</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dll</span><span class="special">::</span><span class="identifier">fs</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&amp;</span><span class="special">,</span> 
            <span class="identifier">load_mode</span><span class="special">::</span><span class="identifier">type</span> <span class="special">=</span> <span class="identifier">load_mode</span><span class="special">::</span><span class="identifier">default_mode</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1afa9da0495e7ab21936d6c4c3b4bce8c5"><span class="identifier">load</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dll</span><span class="special">::</span><span class="identifier">fs</span><span class="special">::</span><span class="identifier">path</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">load_mode</span><span class="special">::</span><span class="identifier">type</span><span class="special">,</span> 
            <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dll</span><span class="special">::</span><span class="identifier">fs</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> <span class="identifier">T</span> <span class="special">&amp;</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a991f75e864cc7bb1dfe43a130562ba18"><span class="identifier">get_variable</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Func<span class="special">&gt;</span> <span class="identifier">Func</span> <span class="special">&amp;</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a958a0864228da48a795d8a628c19dad8"><span class="identifier">get_function</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Class<span class="special">,</span> <span class="keyword">typename</span> Func<span class="special">&gt;</span> 
    <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a50e8663ca471214987488c0c8d69b75b"><span class="identifier">get_mem_fn</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Signature<span class="special">&gt;</span> 
    <span class="identifier">constructor</span><span class="special">&lt;</span> <span class="identifier">Signature</span> <span class="special">&gt;</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a3a07b4c56bea141c6015569100ca6a65"><span class="identifier">get_constructor</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Class<span class="special">&gt;</span> <span class="identifier">destructor</span><span class="special">&lt;</span> <span class="identifier">Class</span> <span class="special">&gt;</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a23ef5ecacabe01414b9c7c2b10f39d2a"><span class="identifier">get_destructor</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Class<span class="special">&gt;</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">type_info</span> <span class="special">&amp;</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a6f9671ad9fb3f93293b65eafbac4577d"><span class="identifier">get_type_info</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Alias<span class="special">&gt;</span> <span class="keyword">void</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a3b62d5d0cd3eada6c8a1bb517ba7c12f"><span class="identifier">add_type_alias</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a4f98671190fa5ccb035c8682ed26a140"><span class="identifier">unload</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a768114474404dc56ef584b512dfd2b44"><span class="identifier">is_loaded</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">explicit</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a420e60e9788bfa3b52aa3aab72ea3a5e"><span class="keyword">operator</span> <span class="keyword">bool</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a61600573e373c540279ac3b5918dd8f1"><span class="identifier">has</span></a><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1ac6d3a6b6218a32a25b8f9ee1f2cc4ab2"><span class="identifier">has</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html" title="Class smart_library">smart_library</a> <span class="special">&amp;</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a033d7e1732714d83c25e8d7f2d7d5a4b"><span class="identifier">assign</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html" title="Class smart_library">smart_library</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a3bc94068bd44352758b9f1e8505084eb"><span class="identifier">swap</span></a><span class="special">(</span><a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html" title="Class smart_library">smart_library</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.12.8.2.8.5.4"></a><h2>Description</h2>
<p>This class allows type safe loading of overloaded functions, member-functions, constructors and variables. It also allows to overwrite classes so they can be loaded, while being declared with different names.</p>
<div class="warning"><table border="0" summary="Warning">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../../../../doc/src/images/warning.png"></td>
<th align="left">Warning</th>
</tr>
<tr><td align="left" valign="top"><p>Experimental feature that relies on an incomplete implementation of platform specific C++ mangling. In case of an issue provide a PR with a fix and tests to <a href="https://github.com/boostorg/dll" target="_top">https://github.com/boostorg/dll</a></p></td></tr>
</table></div>
<p>
Currently known limitations:</p>
<p>Member functions must be defined outside of the class to be exported. That is: </p>
<pre class="programlisting"><span class="comment">//not exported:</span>
<span class="keyword">struct</span> <span class="identifier">BOOST_SYMBOL_EXPORT</span> <span class="identifier">my_class</span> <span class="special">{</span> <span class="keyword">void</span> <span class="identifier">func</span><span class="special">(</span><span class="special">)</span> <span class="special">{</span><span class="special">}</span> <span class="special">}</span><span class="special">;</span>
<span class="comment">//exported</span>
<span class="keyword">struct</span> <span class="identifier">BOOST_SYMBOL_EXPORT</span> <span class="identifier">my_class</span> <span class="special">{</span> <span class="keyword">void</span> <span class="identifier">func</span><span class="special">(</span><span class="special">)</span><span class="special">;</span> <span class="special">}</span><span class="special">;</span>
<span class="keyword">void</span> <span class="identifier">my_class</span><span class="special">::</span><span class="identifier">func</span><span class="special">(</span><span class="special">)</span> <span class="special">{</span><span class="special">}</span>
</pre>
<p>With the current analysis, the first version does get exported in MSVC. MinGW also does export it, BOOST_SYMBOL_EXPORT is written before it. To allow this on windows one can use BOOST_DLL_MEMBER_EXPORT for this, so that MinGW and MSVC can provide those functions. This does however not work with gcc on linux.</p>
<p>Direct initialization of members. On linux the following member variable i will not be initialized when using the allocating constructor: </p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">BOOST_SYMBOL_EXPORT</span> <span class="identifier">my_class</span> <span class="special">{</span> <span class="keyword">int</span> <span class="identifier">i</span><span class="special">;</span> <span class="identifier">my_class</span><span class="special">(</span><span class="special">)</span> <span class="special">:</span> <span class="identifier">i</span><span class="special">(</span><span class="number">42</span><span class="special">)</span> <span class="special">{</span><span class="special">}</span> <span class="special">}</span><span class="special">;</span>
</pre>
<p>This does however not happen when the value is set inside the constructor function. </p>
<div class="refsect2">
<a name="id-1.3.12.8.2.8.5.4.8"></a><h3>
<a name="id4-bb"></a><code class="computeroutput">smart_library</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">const</span> <a class="link" href="classboost_1_1dll_1_1shared__library.html" title="Class shared_library">shared_library</a> <span class="special">&amp;</span> <a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a156b5b44ed1be2f79cf23b13857f9913"></a><span class="identifier">shared_lib</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Get the underlying <a class="link" href="classboost_1_1dll_1_1shared__library.html" title="Class shared_library">shared_library</a> </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">const</span> <span class="identifier">mangled_storage</span> <span class="special">&amp;</span> <a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a51212e822e0b370eedf1a8e5918f271f"></a><span class="identifier">symbol_storage</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Access to the mangled storage, which is created on construction.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Throws:</span></p></td>
<td>Nothing. </td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">mangled_storage</span> <span class="special">&amp;</span> <a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1ad3d73b1b1a7363aec5a4206d81abeecb"></a><span class="identifier">symbol_storage</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Overload, for current development. </li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a2d7c4982300107b0b97267abb8bd33be"></a><span class="identifier">smart_library</span><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span></pre>
<p>Creates in anstance that does not reference any DLL/DSO.</p>
<p>

</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Postconditions:</span></p></td>
<td><p>this-&gt;<a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a768114474404dc56ef584b512dfd2b44">is_loaded()</a> returns false. </p></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td>Nothing. </td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1aa83355fe2c90155b9aa9472e8ee2f6b0"></a><span class="identifier">smart_library</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dll</span><span class="special">::</span><span class="identifier">fs</span><span class="special">::</span><span class="identifier">path</span> <span class="special">&amp;</span> lib_path<span class="special">,</span> 
              <span class="identifier">load_mode</span><span class="special">::</span><span class="identifier">type</span> mode <span class="special">=</span> <span class="identifier">load_mode</span><span class="special">::</span><span class="identifier">default_mode</span><span class="special">)</span><span class="special">;</span></pre>
<p>Loads a library by specified path with a specified mode.</p>
<p>

xmlonly &lt;link linkend='boost.dll.fs.system_error'&gt;boost::dll::fs::system_error&lt;/link&gt;, std::bad_alloc in case of insufficient memory.    </p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">lib_path</code></span></p></td>
<td><p>Library file name. Can handle std::string, const char*, std::wstring, const wchar_t* or  <a class="link" href="../../">boost::dll::fs::path</a>. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">mode</code></span></p></td>
<td><p>A mode that will be used on library load. </p></td>
</tr>
</tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td> </td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a8103619984d16233cbb3dd1a31ec11d8"></a><span class="identifier">smart_library</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dll</span><span class="special">::</span><span class="identifier">fs</span><span class="special">::</span><span class="identifier">path</span> <span class="special">&amp;</span> lib_path<span class="special">,</span> 
              <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dll</span><span class="special">::</span><span class="identifier">fs</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&amp;</span> ec<span class="special">,</span> 
              <span class="identifier">load_mode</span><span class="special">::</span><span class="identifier">type</span> mode <span class="special">=</span> <span class="identifier">load_mode</span><span class="special">::</span><span class="identifier">default_mode</span><span class="special">)</span><span class="special">;</span></pre>
<p>Loads a library by specified path with a specified mode.</p>
<p>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.    </p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">lib_path</code></span></p></td>
<td><p>Library file name. Can handle std::string, const char*, std::wstring, const wchar_t* or  <a class="link" href="../../">boost::dll::fs::path</a>. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">ec</code></span></p></td>
<td><p>Variable that will be set to the result of the operation. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">mode</code></span></p></td>
<td><p>A mode that will be used on library load. </p></td>
</tr>
</tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td>std::bad_alloc in case of insufficient memory.</td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem"><pre class="literallayout"><a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a8fd9bfbf20917d13b9324184220cd1b0"></a><span class="identifier">smart_library</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dll</span><span class="special">::</span><span class="identifier">fs</span><span class="special">::</span><span class="identifier">path</span> <span class="special">&amp;</span> lib_path<span class="special">,</span> <span class="identifier">load_mode</span><span class="special">::</span><span class="identifier">type</span> mode<span class="special">,</span> 
              <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dll</span><span class="special">::</span><span class="identifier">fs</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&amp;</span> ec<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a692d732536a8d5b771fac684bc89394f"></a><span class="identifier">smart_library</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html" title="Class smart_library">smart_library</a> <span class="special">&amp;</span> lib<span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span></pre>
<p>copy a <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html" title="Class smart_library">smart_library</a> object.</p>
<p>

</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">lib</code></span></p></td>
<td><p>A <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html" title="Class smart_library">smart_library</a> to move from.</p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td>Nothing. </td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a592fa252e82dae0e1f9351e0fc8f1859"></a><span class="identifier">smart_library</span><span class="special">(</span><a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html" title="Class smart_library">smart_library</a> <span class="special">&amp;&amp;</span> lib<span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span></pre>
<p>Move a <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html" title="Class smart_library">smart_library</a> object.</p>
<p>

</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">lib</code></span></p></td>
<td><p>A <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html" title="Class smart_library">smart_library</a> to move from.</p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td>Nothing. </td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">explicit</span> <a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a753ef075a1a269d1a1a5e0763a7892b5"></a><span class="identifier">smart_library</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1dll_1_1shared__library.html" title="Class shared_library">shared_library</a> <span class="special">&amp;</span> lib<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Construct from a <a class="link" href="classboost_1_1dll_1_1shared__library.html" title="Class shared_library">shared_library</a> object.</p>
<p>

</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">lib</code></span></p></td>
<td><p>A <a class="link" href="classboost_1_1dll_1_1shared__library.html" title="Class shared_library">shared_library</a> to move from.</p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td>Nothing. </td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">explicit</span> <a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1aff3686addd66c5598dbe8dd47635f1cc"></a><span class="identifier">smart_library</span><span class="special">(</span><a class="link" href="classboost_1_1dll_1_1shared__library.html" title="Class shared_library">shared_library</a> <span class="special">&amp;&amp;</span> lib<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Construct from a <a class="link" href="classboost_1_1dll_1_1shared__library.html" title="Class shared_library">shared_library</a> object.</p>
<p>

</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">lib</code></span></p></td>
<td><p>A <a class="link" href="classboost_1_1dll_1_1shared__library.html" title="Class shared_library">shared_library</a> to move from.</p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td>Nothing. </td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a7dbc2b3e3a8c7e5152f6d56c8a2daa8d"></a><span class="special">~</span><span class="identifier">smart_library</span><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span></pre>
<p>Destroys the <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html" title="Class smart_library">smart_library</a>. <code class="computeroutput"><a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a4f98671190fa5ccb035c8682ed26a140">unload()</a></code> is called if the DLL/DSO was loaded. If library was loaded multiple times by different instances of <a class="link" href="classboost_1_1dll_1_1shared__library.html" title="Class shared_library">shared_library</a>, the actual DLL/DSO won't be unloaded until there is at least one instance of <a class="link" href="classboost_1_1dll_1_1shared__library.html" title="Class shared_library">shared_library</a>.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Throws:</span></p></td>
<td>Nothing. </td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a4a953c50b86191dd96aa471bac8099a6"></a><span class="identifier">load</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dll</span><span class="special">::</span><span class="identifier">fs</span><span class="special">::</span><span class="identifier">path</span> <span class="special">&amp;</span> lib_path<span class="special">,</span> 
          <span class="identifier">load_mode</span><span class="special">::</span><span class="identifier">type</span> mode <span class="special">=</span> <span class="identifier">load_mode</span><span class="special">::</span><span class="identifier">default_mode</span><span class="special">)</span><span class="special">;</span></pre>
<p>Loads a library by specified path with a specified mode.</p>
<p>Note that if some library is already loaded in this instance, load will call <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a4f98671190fa5ccb035c8682ed26a140">unload()</a> and then load the new provided library.</p>
<p>

xmlonly &lt;link linkend='boost.dll.fs.system_error'&gt;boost::dll::fs::system_error&lt;/link&gt;, std::bad_alloc in case of insufficient memory.    </p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">lib_path</code></span></p></td>
<td><p>Library file name. Can handle std::string, const char*, std::wstring, const wchar_t* or  <a class="link" href="../../">boost::dll::fs::path</a>. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">mode</code></span></p></td>
<td><p>A mode that will be used on library load. </p></td>
</tr>
</tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td> </td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1ab226ee5e8f7896cdd3b53dca9704eadd"></a><span class="identifier">load</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dll</span><span class="special">::</span><span class="identifier">fs</span><span class="special">::</span><span class="identifier">path</span> <span class="special">&amp;</span> lib_path<span class="special">,</span> 
          <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dll</span><span class="special">::</span><span class="identifier">fs</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&amp;</span> ec<span class="special">,</span> 
          <span class="identifier">load_mode</span><span class="special">::</span><span class="identifier">type</span> mode <span class="special">=</span> <span class="identifier">load_mode</span><span class="special">::</span><span class="identifier">default_mode</span><span class="special">)</span><span class="special">;</span></pre>
<p>Loads a library by specified path with a specified mode.</p>
<p>Note that if some library is already loaded in this instance, load will call <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a4f98671190fa5ccb035c8682ed26a140">unload()</a> and then load the new provided library.</p>
<p>

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.    </p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">lib_path</code></span></p></td>
<td><p>Library file name. Can handle std::string, const char*, std::wstring, const wchar_t* or  <a class="link" href="../../">boost::dll::fs::path</a>. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">ec</code></span></p></td>
<td><p>Variable that will be set to the result of the operation. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">mode</code></span></p></td>
<td><p>A mode that will be used on library load. </p></td>
</tr>
</tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td>std::bad_alloc in case of insufficient memory.</td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem"><pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1afa9da0495e7ab21936d6c4c3b4bce8c5"></a><span class="identifier">load</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dll</span><span class="special">::</span><span class="identifier">fs</span><span class="special">::</span><span class="identifier">path</span> <span class="special">&amp;</span> lib_path<span class="special">,</span> <span class="identifier">load_mode</span><span class="special">::</span><span class="identifier">type</span> mode<span class="special">,</span> 
          <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dll</span><span class="special">::</span><span class="identifier">fs</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&amp;</span> ec<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> <span class="identifier">T</span> <span class="special">&amp;</span> <a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a991f75e864cc7bb1dfe43a130562ba18"></a><span class="identifier">get_variable</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span> name<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Load a variable from the referenced library.</p>
<p>Unlinke <a class="link" href="classboost_1_1dll_1_1shared__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1shared__library_1a57ca07c405c026200cf5c7799ae36170">shared_library::get</a> this function will also load scoped variables, which also includes static class members.</p>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../doc/src/images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>When mangled, MSVC will also check the type.</p></td></tr>
</table></div>
<p>




xmlonly &lt;link linkend='boost.dll.fs.system_error'&gt;boost::dll::fs::system_error&lt;/link&gt; if symbol does not exist or if the DLL/DSO was not loaded. </p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">name</code></span></p></td>
<td><p>Name of the variable </p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Template Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">T</code></span></p></td>
<td><p>Type of the variable </p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>A reference to the variable of type T.</p></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td> </td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Func<span class="special">&gt;</span> <span class="identifier">Func</span> <span class="special">&amp;</span> <a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a958a0864228da48a795d8a628c19dad8"></a><span class="identifier">get_function</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span> name<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Load a function from the referenced library.</p>
<p><span class="bold"><strong>Example:</strong></span> </p>
<pre class="programlisting"><a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a2d7c4982300107b0b97267abb8bd33be"><span class="identifier">smart_library</span></a> <span class="identifier">lib</span><span class="special">(</span><span class="string">"test_lib.so"</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="keyword">int</span>      <span class="special">(</span><span class="special">&amp;</span><span class="identifier">add_ints</span><span class="special">)</span><span class="special">(</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="keyword">double</span> <span class="special">(</span><span class="special">&amp;</span><span class="identifier">add_doubles</span><span class="special">)</span><span class="special">(</span><span class="keyword">double</span><span class="special">,</span> <span class="keyword">double</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">add_ints</span>     <span class="identifier">f1</span> <span class="special">=</span> <span class="identifier">lib</span><span class="special">.</span><span class="identifier">get_function</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">(</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">)</span><span class="special">&gt;</span>         <span class="special">(</span><span class="string">"func_name"</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">add_doubles</span>  <span class="identifier">f2</span> <span class="special">=</span> <span class="identifier">lib</span><span class="special">.</span><span class="identifier">get_function</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">(</span><span class="keyword">double</span><span class="special">,</span> <span class="keyword">double</span><span class="special">)</span><span class="special">&gt;</span><span class="special">(</span><span class="string">"func_name"</span><span class="special">)</span><span class="special">;</span>
</pre>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../doc/src/images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>When mangled, MSVC will also check the return type.</p></td></tr>
</table></div>
<p>




xmlonly &lt;link linkend='boost.dll.fs.system_error'&gt;boost::dll::fs::system_error&lt;/link&gt; if symbol does not exist or if the DLL/DSO was not loaded. </p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">name</code></span></p></td>
<td><p>Name of the function. </p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Template Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">Func</code></span></p></td>
<td><p>Type of the function, required for determining the overload </p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>A reference to the function of type F.</p></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td> </td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Class<span class="special">,</span> <span class="keyword">typename</span> Func<span class="special">&gt;</span> 
  <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a50e8663ca471214987488c0c8d69b75b"></a><span class="identifier">get_mem_fn</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span> name<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Load a member-function from the referenced library.</p>
<p><span class="bold"><strong>Example</strong></span> (import class is MyClass, which is available inside the library and the host):</p>
<pre class="programlisting"><a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a2d7c4982300107b0b97267abb8bd33be"><span class="identifier">smart_library</span></a> <span class="identifier">lib</span><span class="special">(</span><span class="string">"test_lib.so"</span><span class="special">)</span><span class="special">;</span>

<span class="keyword">typedef</span> <span class="keyword">int</span>      <span class="identifier">MyClass</span><span class="special">(</span><span class="special">*</span><span class="identifier">func</span><span class="special">)</span><span class="special">(</span><span class="keyword">int</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="keyword">int</span>   <span class="identifier">MyClass</span><span class="special">(</span><span class="special">*</span><span class="identifier">func_const</span><span class="special">)</span><span class="special">(</span><span class="keyword">int</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>

<span class="identifier">add_ints</span>     <span class="identifier">f1</span> <span class="special">=</span> <span class="identifier">lib</span><span class="special">.</span><span class="identifier">get_mem_fn</span><span class="special">&lt;</span><span class="identifier">MyClass</span><span class="special">,</span> <span class="keyword">int</span><span class="special">(</span><span class="keyword">int</span><span class="special">)</span><span class="special">&gt;</span>              <span class="special">(</span><span class="string">"MyClass::function"</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">add_doubles</span>  <span class="identifier">f2</span> <span class="special">=</span> <span class="identifier">lib</span><span class="special">.</span><span class="identifier">get_mem_fn</span><span class="special">&lt;</span><span class="keyword">const</span> <span class="identifier">MyClass</span><span class="special">,</span> <span class="keyword">double</span><span class="special">(</span><span class="keyword">double</span><span class="special">)</span><span class="special">&gt;</span><span class="special">(</span><span class="string">"MyClass::function"</span><span class="special">)</span><span class="special">;</span>
</pre>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../doc/src/images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>When mangled, MSVC will also check the return type.</p></td></tr>
</table></div>
<p>




xmlonly &lt;link linkend='boost.dll.fs.system_error'&gt;boost::dll::fs::system_error&lt;/link&gt; if symbol does not exist or if the DLL/DSO was not loaded. </p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">name</code></span></p></td>
<td><p>Name of the function. </p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Template Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">Class</code></span></p></td>
<td><p>The class the function is a member of. If Class is const, the function will be assumed as taking a const this-pointer. The same applies for volatile. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">Func</code></span></p></td>
<td><p>Signature of the function, required for determining the overload </p></td>
</tr>
</tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>A pointer to the member-function with the signature provided</p></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td> </td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Signature<span class="special">&gt;</span> <span class="identifier">constructor</span><span class="special">&lt;</span> <span class="identifier">Signature</span> <span class="special">&gt;</span> <a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a3a07b4c56bea141c6015569100ca6a65"></a><span class="identifier">get_constructor</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Load a constructor from the referenced library.</p>
<p><span class="bold"><strong>Example</strong></span> (import class is MyClass, which is available inside the library and the host):</p>
<pre class="programlisting"><a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a2d7c4982300107b0b97267abb8bd33be"><span class="identifier">smart_library</span></a> <span class="identifier">lib</span><span class="special">(</span><span class="string">"test_lib.so"</span><span class="special">)</span><span class="special">;</span>

<span class="identifier">constructor</span><span class="special">&lt;</span><span class="identifier">MyClass</span><span class="special">(</span><span class="keyword">int</span><span class="special">)</span>    <span class="identifier">f1</span> <span class="special">=</span> <span class="identifier">lib</span><span class="special">.</span><span class="identifier">get_mem_fn</span><span class="special">&lt;</span><span class="identifier">MyClass</span><span class="special">(</span><span class="keyword">int</span><span class="special">)</span><span class="special">&gt;</span><span class="special">(</span><span class="special">)</span><span class="special">;</span>
</pre>
<p>


xmlonly &lt;link linkend='boost.dll.fs.system_error'&gt;boost::dll::fs::system_error&lt;/link&gt; if symbol does not exist or if the DLL/DSO was not loaded. </p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Template Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">Signature</code></span></p></td>
<td><p>Signature of the function, required for determining the overload. The return type is the class which this is the constructor of. </p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>A constructor object.</p></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td> </td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Class<span class="special">&gt;</span> <span class="identifier">destructor</span><span class="special">&lt;</span> <span class="identifier">Class</span> <span class="special">&gt;</span> <a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a23ef5ecacabe01414b9c7c2b10f39d2a"></a><span class="identifier">get_destructor</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Load a destructor from the referenced library.</p>
<p><span class="bold"><strong>Example</strong></span> (import class is MyClass, which is available inside the library and the host):</p>
<pre class="programlisting"><a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a2d7c4982300107b0b97267abb8bd33be"><span class="identifier">smart_library</span></a> <span class="identifier">lib</span><span class="special">(</span><span class="string">"test_lib.so"</span><span class="special">)</span><span class="special">;</span>

<span class="identifier">destructor</span><span class="special">&lt;</span><span class="identifier">MyClass</span><span class="special">&gt;</span>     <span class="identifier">f1</span> <span class="special">=</span> <span class="identifier">lib</span><span class="special">.</span><span class="identifier">get_mem_fn</span><span class="special">&lt;</span><span class="identifier">MyClass</span><span class="special">&gt;</span><span class="special">(</span><span class="special">)</span><span class="special">;</span>
</pre>
<p>


xmlonly &lt;link linkend='boost.dll.fs.system_error'&gt;boost::dll::fs::system_error&lt;/link&gt; if symbol does not exist or if the DLL/DSO was not loaded. </p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Template Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">Class</code></span></p></td>
<td><p>The class whose destructor shall be loaded </p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>A destructor object.</p></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td> </td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Class<span class="special">&gt;</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">type_info</span> <span class="special">&amp;</span> <a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a6f9671ad9fb3f93293b65eafbac4577d"></a><span class="identifier">get_type_info</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Load the typeinfo of the given type.</p>
<p><span class="bold"><strong>Example</strong></span> (import class is MyClass, which is available inside the library and the host):</p>
<pre class="programlisting"><a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a2d7c4982300107b0b97267abb8bd33be"><span class="identifier">smart_library</span></a> <span class="identifier">lib</span><span class="special">(</span><span class="string">"test_lib.so"</span><span class="special">)</span><span class="special">;</span>

<span class="identifier">std</span><span class="special">::</span><span class="identifier">type_info</span> <span class="special">&amp;</span><span class="identifier">ti</span> <span class="special">=</span> <span class="identifier">lib</span><span class="special">.</span><span class="identifier">get_Type_info</span><span class="special">&lt;</span><span class="identifier">MyClass</span><span class="special">&gt;</span><span class="special">(</span><span class="special">)</span><span class="special">;</span>
</pre>
<p>


xmlonly &lt;link linkend='boost.dll.fs.system_error'&gt;boost::dll::fs::system_error&lt;/link&gt; if symbol does not exist or if the DLL/DSO was not loaded. </p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Template Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">Class</code></span></p></td>
<td><p>The class whose typeinfo shall be loaded </p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>A reference to a type_info object.</p></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td> </td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Alias<span class="special">&gt;</span> <span class="keyword">void</span> <a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a3b62d5d0cd3eada6c8a1bb517ba7c12f"></a><span class="identifier">add_type_alias</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span> name<span class="special">)</span><span class="special">;</span></pre>
<p>This function can be used to add a type alias.</p>
<p>This is to be used, when a class shall be imported, which is not declared on the host side.</p>
<p>Example: </p>
<pre class="programlisting"><a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a2d7c4982300107b0b97267abb8bd33be"><span class="identifier">smart_library</span></a> <span class="identifier">lib</span><span class="special">(</span><span class="string">"test_lib.so"</span><span class="special">)</span><span class="special">;</span>

<span class="identifier">lib</span><span class="special">.</span><span class="identifier">add_type_alias</span><span class="special">&lt;</span><span class="identifier">MyAlias</span><span class="special">&gt;</span><span class="special">(</span><span class="string">"MyClass"</span><span class="special">)</span><span class="special">;</span> <span class="comment">//when using MyAlias, the library will look for MyClass</span>

<span class="comment">//get the destructor of MyClass</span>
<span class="identifier">destructor</span><span class="special">&lt;</span><span class="identifier">MyAlias</span><span class="special">&gt;</span> <span class="identifier">dtor</span> <span class="special">=</span> <span class="identifier">lib</span><span class="special">.</span><span class="identifier">get_destructor</span><span class="special">&lt;</span><span class="identifier">MyAlias</span><span class="special">&gt;</span><span class="special">(</span><span class="special">)</span><span class="special">;</span>
</pre>
<p>
</p>
<div class="important"><table border="0" summary="Important">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../../../../doc/src/images/important.png"></td>
<th align="left">Important</th>
</tr>
<tr><td align="left" valign="top"><p>If the alias-type is not large enough for the imported class, it will result in undefined behaviour. </p></td></tr>
</table></div>
<p>
</p>
<div class="warning"><table border="0" summary="Warning">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../../../../doc/src/images/warning.png"></td>
<th align="left">Warning</th>
</tr>
<tr><td align="left" valign="top"><p>The alias will only be applied for the type signature, it will not replace the token in the scoped name. </p></td></tr>
</table></div>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">name</code></span></p></td>
<td><p>Name of the class the alias is for.</p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a4f98671190fa5ccb035c8682ed26a140"></a><span class="identifier">unload</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Unloads a shared library. If library was loaded multiple times by different instances, the actual DLL/DSO won't be unloaded until there is at least one instance that references the DLL/DSO.</p>
<p>

</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Postconditions:</span></p></td>
<td><p>this-&gt;<a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html#doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a768114474404dc56ef584b512dfd2b44">is_loaded()</a> returns false. </p></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td>Nothing. </td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a768114474404dc56ef584b512dfd2b44"></a><span class="identifier">is_loaded</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Check if an library is loaded.</p>
<p>

</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>true if a library has been loaded. </p></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td>Nothing. </td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">explicit</span> <a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a420e60e9788bfa3b52aa3aab72ea3a5e"></a><span class="keyword">operator</span> <span class="keyword">bool</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>bool() const <p>bool() const </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a61600573e373c540279ac3b5918dd8f1"></a><span class="identifier">has</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> symbol_name<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Search for a given symbol on loaded library. Works for all symbols, including alias names.</p>
<p>


This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.    </p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">symbol_name</code></span></p></td>
<td><p>Null-terminated symbol name. Can handle std::string, char*, const char*. </p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p><code class="computeroutput">true</code> if the loaded library contains a symbol with a given name. </p></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td>Nothing. </td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1ac6d3a6b6218a32a25b8f9ee1f2cc4ab2"></a><span class="identifier">has</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span> symbol_name<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html" title="Class smart_library">smart_library</a> <span class="special">&amp;</span> <a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a033d7e1732714d83c25e8d7f2d7d5a4b"></a><span class="identifier">assign</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html" title="Class smart_library">smart_library</a> <span class="special">&amp;</span> lib<span class="special">)</span><span class="special">;</span></pre>
<p>Makes *this share the same shared object as lib. If *this is loaded, then unloads it.</p>
<p>


xmlonly &lt;link linkend='boost.dll.fs.system_error'&gt;boost::dll::fs::system_error&lt;/link&gt;, std::bad_alloc in case of insufficient memory.    </p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">lib</code></span></p></td>
<td><p>A library instance to assign from. </p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Postconditions:</span></p></td>
<td><p>lib.location() == this-&gt;location() </p></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td> </td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.shared_library_reference.classboost_1_1dll_1_1experimental_1_1smart__library_1a3bc94068bd44352758b9f1e8505084eb"></a><span class="identifier">swap</span><span class="special">(</span><a class="link" href="classboost_1_1dll_1_1experimental_1_1smart__library.html" title="Class smart_library">smart_library</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Swaps two libraries. Does not invalidate existing symbols and functions loaded from libraries.</p>
<p>

</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">rhs</code></span></p></td>
<td><p>Library to swap with. </p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td>Nothing. </td>
</tr>
</tbody>
</table></div>
</li>
</ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2014 Renato Tegon Forti, Antony Polukhin<br>Copyright © 2015 Antony Polukhin<br>Copyright © 2016 Antony Polukhin, Klemens Morgenstern<br>Copyright © 2017-2025 Antony
      Polukhin<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="shared__library__load__mode_8hpp_1a7aead736a07eaf25623ad7bfa1f0ee2d.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_dll/reference.html#doxygen.shared_library_reference.smart__library_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="smart__library_8hpp_1aca01518fa6ec64ce2f8f56ad2a232732.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
